﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Mr.LinqToWeibo
{
    public static class QueryableWeiboDataExtension
    {
        public static IQueryable<TSource> PageSize<TSource>(this IQueryable<TSource> queryable, int pageSize)
        {
            return queryable.Take(pageSize);
        }

        public static IQueryable<TSource> PageIndex<TSource>(this IQueryable<TSource> queryable, int pageIndex)
        {
            return queryable.Skip((pageIndex <= 0 ? 1 : pageIndex) - 1);
        }
    }
}
